package com.mililoan.service.module.system.impl;

import java.util.ArrayList;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mililoan.model.system.Function;
import com.mililoan.persist.system.FuncDao;
import com.mililoan.service.module.system.FuncBo;

@Service("FuncBo")
public class FuncBoImpl implements FuncBo {
	@Autowired
	FuncDao funcDao;
	
	private ArrayList<Function> modules;
	private ArrayList<Function> funcs;
	
	/**
	 * 为modules 和 funcs 赋值
	 * 
	 * @return void
	 * @author mwei
	 */
	public void getAll() {
		modules = new ArrayList<Function>();
		funcs = new ArrayList<Function>();
		funcDao.getAll(modules, funcs);
	}
	
	public ArrayList<Function> getAllModules() {
		if(null == modules){this.getAll();}
		return modules;
	}

	public ArrayList<Function> getAllFuncs() {
		if (null == funcs) {this.getAll();}
		return funcs;
	}

}
